<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-添加热门关键字">
</@frame.head>
<div class="page-container">
	<form action="${contextPath}/hot_key_words/insert_hot_key_words" method="post" class="form form-horizontal" id="save_form">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">
				热门关键字：</label>
			<div class="formControls col-xs-6 col-sm-6">
				<input type="text" class="input-text" value="" placeholder="请输入关键字" id="keyWords" name="keyWords" >
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">
				上架时间：</label>
			<div class="formControls col-xs-6 col-sm-6">
				<input  type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'endDate\')}',readOnly: true })" id="startDate" 
                name="startTime"  class="input-text Wdate">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">
				下架时间：</label>
			<div class="formControls col-xs-6 col-sm-6">
				  <input  type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'startDate\')}',readOnly: true })" id="endDate" 
                  name="endTime"    class="input-text Wdate">
			</div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-2">
				<input class="btn btn-primary radius" type="button" onclick="save();"  value="保存">
			</div>
		</div>
	</form>
</div>
<@frame.end "default">
</@frame.end>
<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript">
var path="${contextPath}";
function save(){
	layer.closeAll('dialog');
	var layer_load_window = layer.load(2); 
	$("#save_form").ajaxSubmit({
			error : function() {
				layer.alert("操作失败！");
	        },
			success : function(data) {
			    if(data == "success"){
				    layer.msg('添加成功!',{icon:1,time:1000},function(){
				    	var index = parent.layer.getFrameIndex(window.name);
				    	parent.$("#search_form").submit();
				    	parent.layer.close(index);
				    	
				    });
			   }else{
				layer.alert("操作失败！");
			   }
			},
			complete: function(XMLHttpRequest, textStatus) {
				layer.close(layer_load_window);
			}
		  })	
}
</script>